[None][fix] Fix nemotron-h quant and loading config#16833
Conversation
…ckpoints DecoderModelForCausalLM only resolved the lm_head quant entry from the per-layer quant_config_dict (MIXED_PRECISION checkpoints). A homogeneous checkpoint with a single global quant_algo that quantizes lm_head (and does not exclude it) built lm_head unquantized, so loading its packed NVFP4 weight failed with a shape mismatch (e.g. Nemotron-Nano-3.5 NVFP4: 'size of tensor a (2688) must match tensor b (1344)'). Resolve lm_head_quant_config from config.quant_config when quant_config_dict is None and the global config quantizes, and share the exclude_modules / tie_word_embeddings / lm-head-TP-in-ADP guards across both sources. No-op for existing models: the MIXED_PRECISION path is unchanged, and homogeneous checkpoints that keep lm_head in FP16 list it in exclude_modules, so the exclude guard keeps it unquantized as before. Verified on Nemotron-Nano-3.5 NVFP4 (W4A16_NVFP4 + FP8 KV) on H100: single-GPU and 4-GPU attention-DP + EP now load and generate coherently (with and without MTP). Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
NemotronHHfWeightMapper gated the structural (z/x/B/C/dt) TP split of the mamba in_proj block scales on quant_algo == "NVFP4", which misses W4A16_NVFP4 (and W4A8_NVFP4_FP8). For those checkpoints the packed in_proj weight was TP-split structurally but its group scales were passed through and even-split by the base loader, so weight and scale ended up misaligned and TP>1 produced garbage (TP1 / attention-DP use tp_size=1, so the split is identity and were unaffected). Use quant_config.quant_mode.has_nvfp4() so all NVFP4 variants take the structural scale split. Verified on Nemotron-Nano-3.5 NVFP4 (W4A16_NVFP4 + FP8 KV) on 4x H100: TP4 and TEP4 (with and without MTP) now generate coherently; previously all produced garbage. Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
WalkthroughUpdates NVFP4 detection to cover the full NVFP4 family and extracts decoder lm_head quantization selection into a reusable resolver used during model initialization. ChangesQuantization updates
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/bot run --disable-fail-fast |
|
PR_Github #61545 [ run ] triggered by Bot. Commit: |
|
PR_Github #61545 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #61572 [ run ] triggered by Bot. Commit: |
|
PR_Github #61572 [ run ] completed with state
|
Dev Engineer Review
in_projscale splitting to detect the full NVFP4 quantization family viahas_nvfp4(), covering variants such asW4A16_NVFP4andW4A8_NVFP4_FP8.lm_headquantization resolution in_resolve_lm_head_quant_config, preserving exclusion, tied-embedding, and TP-in-ADP compatibility guards while enabling global quantization configuration for homogeneous checkpoints.QA Engineer Review
No test changes.
Description
Test Coverage
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.